const inp =document.querySelector('.sci')
    const ulBox=document.querySelector('.scu')

    inp.oninput=function(){
    const text =inp.value.trim()
    const script =document.createElement('script')
    script.src=`https://www.baidu.com/sugrec?pre=1&p=3&ie=utf-8&json=1&prod=pc&from=pc_web&sugsid=34443,35104,35237,35049,34584,34518,35234,34579,34606,34815,26350,35145,22159&wd=${ text }&req=2&csor=1&cb=handler&_=1637892915435`
    document.body.appendChild(script)
    script.remove()
    }
    
    
    function handler(res){
        if(!res.g){
            ulBox.style.display='none'
            return
    }
        let str =''
        res.g.forEach(item => {
        str+=` <li>${ item.q }</li>`
             
     })
        ulBox.innerHTML=str
        ulBox.style.display='block'
    }